﻿using System;
using System.Collections.ObjectModel;
using Coniometer.Model;
using Prism.Mvvm;

namespace Coniometer.ViewModels
{
    public class ManagementPageViewModel : BindableBase
    {
        private ObservableCollection<UserModel> _userCollection = new ObservableCollection<UserModel>();

        public ObservableCollection<UserModel> UserCollection
        {
            get => _userCollection;
            set
            {
                _userCollection = value;
                RaisePropertyChanged();
            }
        }

        public ManagementPageViewModel()
        {
            for (var i = 1; i < 15; i++)
            {
                var dataModel = new UserModel
                {
                    Ordinal = $"00{i}",
                    UserName = $"张三{Guid.NewGuid().ToString().ToUpper().Substring(0, 4)}",
                    UserRole = "管理员",
                    Password = "******",
                    PwdExpirationDate = "2025/07/13 至 2025/07/31",
                    UserExpirationDate = "2025/07/13 至 2025/07/31",
                    State = i % 2 == 0 ? "开启" : "关闭"
                };
                UserCollection.Add(dataModel);
            }
        }
    }
}